00001 <?php
00003 define("PATH_TO_ROOT", "../");
00005 require_once (PATH_TO_ROOT."common/init.inc.php");
00006 require_once ("./admin/classes/class.gallerysettings.inc.php");
00007 require_once ("./classes/class.photofunctions.inc.php");
00008 require_once (PATH_TO_ROOT."common/classes/class.bbcode.inc.php");
00009
00010 require_once (PATH_TO_ROOT."/style/classes/class.style.inc.php");
00011 $STYLES_CSSFILE = Style::getCSSPath() ."stylesheets.css";
00012 $testAlbum = new IntegerNumberData($_GET['album']);
00013 if ($testAlbum->IsValid()) $slide_album = $testAlbum->data;
00014 if (isset($_GET['current'])) {
00015 $testCurrent = new IntegerNumberData($_GET['current']);
00016 if ($testCurrent->IsValid()) $slide_current = $testCurrent->data;
00017 } else $slide_current = 0;
00018 if (!isset($slide_current) || $slide_current < 0) $slide_current = 0;
00019 $slide_stopped = isset($_GET['stopped']);
00020 $hasright = getAlbumRight('view', $slide_album);
00021 if ($slide_album) {
00022 $album_entry = $db->get_row("SElECT * FROM forum_board WHERE boardid=$slide_album AND is_photogallery=1 LIMIT 1");
00023 if (!$album_entry || ($album_entry->boarddisabled && !getAlbumRight('admin', $slide_album))) $hasright = false;
00024 else {
00025 $picentries = $db->get_results("SElECT * FROM forum_thread WHERE boardid=$slide_album ORDER BY threadcreationtime");
00026 if (!$picentries) $hasright = false;
00027 else {
00028 $slide_current%= count($picentries);
00029 }
00030 }
00031 } else $hasright = false;
00032 ?>
00033 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
00034 <html lang="de">
00035 <head>
00036 <title>eStudy - Slideshow</title>
00037 <meta http-equiv="Content-Type" content="text/html; charset=<?php
00038 echo $settings["charset"]; ?>" />
00039 <?php
00040 if ($hasright && !$slide_stopped) echo "<meta http-equiv='Refresh' content='".$photosettings->get_slidetime() ."; url=slideshow.php?album=$slide_album&current=".($slide_current+1) ."' />";
00041 ?>
00042 <link href="<?php echo $STYLES_CSSFILE
00043 ?>" rel="stylesheet" type="text/css" />
00044 <?php
00045
00046 if (file_exists(Style::getCSSPath() ."ieextra.css")) echo "\t<!--[if lt IE 7]><link href=\"".Style::getCSSPath() ."ieextra.css\" rel=\"stylesheet\" type=\"text/css\" /><![endif]-->\n";
00047
00048
00049 if (file_exists(Style::getCSSPath() ."ie_pngfix.js")) echo "\t<!--[if lt IE 7]><script type=\"text/javascript\">var stylepath='".Style::getCSSPath() ."';</script><script defer=\"defer\" type=\"text/javascript\" src=\"".Style::getCSSPath() ."ie_pngfix.js\"></script><![endif]-->\n";
00050 ?>
00051 </head>
00052 <body>
00053 <?php
00054 if ($hasright && $album_entry) {
00055 if (count($picentries) > 0) {
00056 $postpic = $db->get_row("SELECT postfilename, postfilesavename, posttext, postcode, postsmilies FROM forum_post WHERE threadid=".$picentries[$slide_current]->threadid." LIMIT 1");
00057 if ($postpic) $picPath = PATH_TO_ROOT.$settings["upload_path"].'forum/course/'.$_SESSION['course'].'/board/'.$slide_album.'/'.$postpic->postfilesavename;
00058 $picSize = GetImageSize($picPath);
00059 $ext = '&ext='.strrchr($postpic->postfilename, '.');
00060 $maxWidth = 980;
00061 $maxHeight = 560;
00062 $maxW = "";
00063 $maxH = "";
00064 if ($picSize[2]) {
00065 if ($picSize[0] > $maxWidth) $maxW = '&maxw='.$maxWidth;
00066 if ($picSize[1] > $maxHeight) $maxH = '&maxh='.$maxHeight;
00067 }
00068 echo "<div style='text-align:center;marign:0 auto;'>";
00069 echo "<strong>{$album_entry->boardname}</strong> - ".($slide_current+1) .". Bild von ".count($picentries) ."<br/>";
00070
00071 if ($slide_current > 0) echo "<a href='slideshow.php?album=$slide_album&current=".($slide_current-1) ."&stopped=1'>Vorheriges</a> | ";
00072 if ($slide_stopped) echo "<a href='slideshow.php?album=$slide_album&current=".($slide_current+1) ."'>Weitermachen</a> | ";
00073 else echo "<a href='slideshow.php?album=$slide_album&current=".($slide_current) ."&stopped=1'>Stop</a> | ";
00074 echo "<a href='board.php?boardid=$slide_album'>Übersicht</a> | ";
00075 echo "<a href='slideshow.php?album=$slide_album&current=".($slide_current+1) ."&stopped=1'>Nächstes</a>";
00076 echo "<br/><br/>";
00077
00078 if ($picPath) {
00079 echo "<a href='showtopic.php?threadid=".$picentries[$slide_current]->threadid."' title='Klicken, um Kommentare anzuzeigen'><img src='".PATH_TO_ROOT."common/makethumb.php?picurl=".rawurlencode($picPath) .$maxW.$maxH.$ext."' alt='Galeriebild' style='border: 1px solid #000000;' /></a><br/><br/>";
00080 } else echo "<div class='error'>Fehler im Bildpfad! Bitte melden Sie die URL einem Admin.</div>";
00081 echo "<strong>".$picentries[$slide_current]->threadtopic."</strong><br/>";
00082 $bbcode = new BBCode(true, true, (bool)$postpic->postsmilies, (bool)$postpic->postcode);
00083 echo "<div class='tableCell' style='width:60%;text-align:left;margin:0 auto;padding:5px;border:1px dashed black;'>".$bbcode->parse($postpic->posttext) ."</div>";
00084 } else {
00085 echo "<div class='error'>";
00086 echo "Es gibt noch keine Bilder in diesem Album!";
00087 }
00088 } else {
00089 echo "<div class='error'>";
00090 echo "Sie haben nicht das Recht, in dieses Album zu sehen!";
00091 }
00092 ?>
00093 </div>
00094 </body>
00095 </html>